<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
	    <meta name="viewport" content="width=device-width, initial-scale=1">
	    <link rel="stylesheet" type="text/css" href="__PUBLIC__/lib/bootstrap/css/bootstrap.min.css"/>
	    <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/base.css"/>
	    <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/style.css"/>
	</head>
	<style>
	a:hover {   
 
text-decoration: none;   
}   
	</style>
	<body  style="background:transparent;">
			  
				<div class="pad-20">
					<div class="panel panel-default linear">
					  	<div class="panel-heading title">充值管理</div>
					  	<div class="panel-body">
					  		<link rel="stylesheet" type="text/css" href="__PUBLIC__/lib/jedate/skin/jedate.css"/>
					  		<script type="text/javascript" src="__PUBLIC__/lib/jedate/jedate.min.js" ></script>
					  		<div class="pad-20">
					  			<form class="form-inline" method="get">
					  			<!--<div class="form-group">
								    
								   <input placeholder="输入会员关键字" name="key" value="" class="form-control " style="" type="text"> 
								  </div>-->
								  <div class="form-group">
			                            <div class="input-group">
			                                <div class="input-group-addon">开始时间</div>
			                                <input id="start_time" name="start_time" class="form-control stu1" type="text" value="{$start_time}" placeholder="输入开始日期" value="{$s1}">
			                            </div>
			                        </div>
			                        <div class="form-group">
			                            <div class="input-group">
			                                <div class="input-group-addon">结束时间</div>
			                                <input id="end_time" name="end_time" class="form-control stu2" type="text" value="{$end_time}" placeholder="输入结束日期" value="{$s2}">
			                            </div>
			                        </div>
								  <button type="submit" class="btn btn-default">查询</button>
								</form>
								
							
								
								<div class="pad-20"></div>
								<div class="table-responsive">
								  <table class="table">
								    <tr>
										<th>充值ID</th>
										<th>充值类型</th>
										<th>充值金额</th>
										<th>充值前金额</th>
										<th>充值后金额</th>
										<th>充值日期</th>
										<th>用户银行卡号</th>
										<th>用户开户银行</th>
										<th>用户开户姓名</th>
										<th>是否已审核</th>
										<th>操作</th>
									</tr>
								    <tbody>
									<foreach name='logs' item='log'>
									<tr>
										<td>{$log.log_id}</td>
										<td>{$active[$log['log_type']]}</td>
										<td>{$log.log_num}</td>
										<td>{$log.log_old_num}</td>
										<td>{$log.log_new_num}</td>
										<td>{$log.log_date|date="Y-m-d",###}</td>
										<php>
											$user_bank_info = json_decode($log['user_bank_info'], true);
										</php>
										<td>{$user_bank_info['bank_num']}</td>
										<td>{$user_bank_info['bank_name']}</td>
										<td>{$user_bank_info['bank_username']}</td>
										<td>{$status[$log['log_is_state']]}</td>
										<td>
											<if condition="$log.log_is_state eq '0'" >
											<a href="javascript:is_state({$log.log_id});" class="btn btn-primary btn-xs btn-success">审核</a>
											</if>
										</td>
									</tr>
									</foreach>
								</tbody>
									 
								    
								  </table>
								</div>
								<div class="f-right">
								  <ul class="pagination">
								    {$page}
								  </ul>
								</div>
								<script type="text/javascript">
		                            jeDate({
		                                dateCell:".stu1",
		                                format:"YYYY-MM-DD",
		                                isTime:false,
		                                minDate:"1900-1-1",
		                                maxDate:"2099-12-12"
		                            });
		                            jeDate({
		                                dateCell:".stu2",
		                                format:"YYYY-MM-DD",
		                                isTime:false,
		                                minDate:"1900-1-1",
		                                maxDate:"2099-12-12"
		                            });
		                        </script>
					  		</div>
					  	</div>
					</div>
				</div>
			</div>
		</div>
	</body>
	<link href="__PUBLIC__/css/sweetalert/sweetalert.css" rel="stylesheet">
	<script type="text/javascript" src="__PUBLIC__/lib/bootstrap/js/jquery.min.js" ></script>
	<link href="__PUBLIC__/css/sweetalert/sweetalert.css" rel="stylesheet">
 	<script src="__PUBLIC__/js/sweetalert/sweetalert.min.js"></script>
	<script type="text/javascript">
		function is_state(log_id) {
			swal({
				title: "确定审核？",
				text: "审核后将无法恢复，请谨慎操作！",
				type: "warning",
				showCancelButton: true,
				confirmButtonColor: "#27c24c",
				confirmButtonText: "通过",
				closeOnConfirm: false
			}, function() {
				$.ajax({
					type: 'post',
					url: '/Admin/Index/check_top_up',
					data: {
						log_id: log_id
					},
					cache: false,
					dataType: 'json',
					success: function(data) {
						if(data.code === 0) {
							swal(data.message, "", "success");
						} else {
							swal(data.message, "", "error");
						}
					}
				});
	
			});
		}
	</script>
</html>